<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       
        // var arr = [1,2,3];

        // console.log(arr.join('='));

        // console.log(obj.join('!'));

        // console.log(obj.toString());

        // console.log(obj);

        // var obj = {
        //     name:"老王",
        //     age:18
        // };

        // // keys - 键名    
        // // console.log(Object.keys(obj)); //['name','age'];
        // var arr = Object.keys(obj);
        // console.log(arr);

        // // values - 键值
        // var arr2 = Object.values(obj);
        // console.log(arr2);


       
        var obj2 = {
            name:"小李",
            age:19
        }
        // 创建一个 以 第一个参数为原型对象的对象。
        // 参数1：原型对象
        // 参数2：create创建的对象属性。
        var obj3 = Object.create(obj2,{
            sex:{
                value:"男",
                writable:true, //可修改
                configurable:true, //可删除
                enumerable:true, //可枚举/遍历
            },
            like:{
                writable:true,
                value:['篮球','足球','羽毛球'],
                enumerable:true,
            }
        });

        obj3.sex = '女';
        // obj3.like.push('乒乓球')
        obj3.like = '乒乓球';

        // delete obj3.sex;

        for(var j in obj3){
            console.log(j);
        }

        console.log(obj3);

        var obj = {
            name:"老王",
            age:19,
            sex:"男",
            like:['篮球','足球','羽毛球']
        }

        obj.name = '啦啦啦';
        obj.like = '划龙舟';

        delete obj.age;

        for(var i in obj){
            console.log(i);
        }

        console.log(obj);


        



    </script>
</body>
</html>